<?php 
include('../../Connections/KRAPPERCON.php');
$combo = '';
include('../../Query_Min/getAlmacenes.php');
$combo_alm = $combo;
$buscar = false;
$find = false;
$itm_cnt = 0;
$monto = 0;
$tot = 0;
$nroped = '';
$noedit = '';
$tot = 0;

$oper = getVal('oper');

if ($oper == 'view'){
$ped = getVal('pedido');
$buscar = true;
	$sql = "call sp_getPedidoDetAll('".$ped."');";
	doEcho($sql);
	$res = $mysqli->query($sql);
	if($res){
		while($row = $res->fetch_assoc()){
			$find = true;
			 $itm_cnt = $itm_cnt + 1;
			$pd_posn[] = $row['PedidoPos'];
			$pd_cods[] = $row['ArticuloID'];
			$pd_noms[] = $row['DetPedTxt'];
			$pd_prun[] = $row['DetPedPru'];
			$pd_qtpe[] = $row['DetPedQtp'];
			$pd_qtat[] = $row['DetPedQta'];
			$pd_dcto[] = $row['DetPedDcto'];
			$pd_cost[] = $row['DetPedCst'];
			$pd_nets[] = $row['DetPedNet'] - $row['DetPedIva'] ;
			$pd_almc[] = $row['AlmacenID'];
			$pd_dels[] = $row['DetPedDel'];
			$pd_pvp[] =  $row['DetPedNet']  ;
			$pd_pdct[] = $row['DetPedPdc'];
			$pd_pvu[] = $row['DetPedPvp'];
		}
				
        include ('OperItmPD.php');
        
	$res->close();
	$mysqli->check_result();
	}

}
?>
<script type="text/javascript">
calcPD1();
</script>
